package com.example.ying.repository.neo4j;

import com.example.ying.model.domain.neo4j.Actor;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.neo4j.repository.query.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface ActorRepository extends Neo4jRepository<Actor, Long> {

    //获取出演index电影的演员
    @Query("MATCH (n:`演员`)-[r:`出演`]->(m:`电影`) where m.index=$index return n")
    List<Actor> findActorByMovieIndex(@Param("index") String index);

}
